for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"use strict";
/* eslint-disable no-unused-vars */
const chai = require('chai');
const chaiHttp = require('chai-http');
const server = require('../../app');
let should = chai.should();
chai.use(chaiHttp);
/* global describe */
/* global it */
describe("test all routes", () => {
describe('/GET index', () => {
it('it should return object', (done) => {
chai.request(server)
.get('/')
.end((err, res) => {
res.should.have.status(200);
res.should.be.json;
res.should.be.json
done();
});
describe('/GET post', () => {
it('it should return post information from Stackoverflow', (done) => {
.get('/posts/47810715')
let items = res.body.json.items;
items[0].title.should.equal("login template accepting every input");
items[0].link.should.equal("https://stackoverflow.com/q/47810715");
describe('/GET Error', () => {
it('should return error', (done) => {
.get("/munge")
res.header["content-type"].should.equal("application/json; charset=utf-8");
res.body.should.be.a("object");